{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd\n",
    "import matplotlib.pyplot as plt\n",
    "import numpy as np\n",
    "%matplotlib inline"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [],
   "source": [
    "df=pd.read_csv('height-weight.csv')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Weight</th>\n",
       "      <th>Height</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>45</td>\n",
       "      <td>120</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>58</td>\n",
       "      <td>135</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>48</td>\n",
       "      <td>123</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>60</td>\n",
       "      <td>145</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>70</td>\n",
       "      <td>160</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   Weight  Height\n",
       "0      45     120\n",
       "1      58     135\n",
       "2      48     123\n",
       "3      60     145\n",
       "4      70     160"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Text(0, 0.5, 'Height')"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYUAAAEGCAYAAACKB4k+AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8vihELAAAACXBIWXMAAAsTAAALEwEAmpwYAAAYbUlEQVR4nO3df5TldX3f8efLRXExmjXumrgDhNUDWH4omAkROKGY2C7xUKE00eXExlOtJCmGYBKsW60kbTiQolKj0YQqJTZxkeSQLdHqonIq1QY5QxbDgm7dIyoza9lVumCS7RbWd/+437l7We7szuzM/TnPxzlz5t7P93vn+/7MAG++n+/n83mnqpAkCeAZgw5AkjQ8TAqSpDaTgiSpzaQgSWozKUiS2o4adACLsXr16jrhhBMGHYYkjZR77733u1W1ptuxkU4KJ5xwAlNTU4MOQ5JGSpJvzXXM4SNJUptJQZLUZlKQJLWZFCRJbSYFSVLbSM8+kqRhsnnrDNdv2c7OPXtZu2olV60/mYvPnBh0WAtiUpCkJbB56wwbb7ufvU/sB2Bmz1423nY/wEglBoePJGkJXL9lezshzNr7xH6u37J9QBEdGe8UJI29d22+n01ffpj9VaxIuPSnjuN3Lz59Sa+xc8/eBbUPK+8UJI21d22+nz+5+9vsbwqK7a/iT+7+Nu/afP+SXmftqpULah9WJgVJY23Tlx9eUPuRumr9yax85oqntK185gquWn/ykl6n1xw+kjTW9s9Rcniu9iM1+zDZ2UeSNMRWJF0TwIpkya918ZkTI5cEDubwkaSxdulPHbeg9uWuZ0khyU1JdiXZ1tF2RpK7k9yXZCrJWR3HNibZkWR7kvW9ikvS8vK7F5/OG155fPvOYEXCG155/JLPPhoXqSUeV2v/4OQ84G+B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kaWt4pSJLavFOQJLWZFCRJbSYFSVKbSUGS1GZSkCS1/X+xsPaXYWIdLAAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "##scatter plot\n",
    "plt.scatter(df['Weight'],df['Height'])\n",
    "plt.xlabel(\"Weight\")\n",
    "plt.ylabel(\"Height\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Weight</th>\n",
       "      <th>Height</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>Weight</th>\n",
       "      <td>1.000000</td>\n",
       "      <td>0.931142</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Height</th>\n",
       "      <td>0.931142</td>\n",
       "      <td>1.000000</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "          Weight    Height\n",
       "Weight  1.000000  0.931142\n",
       "Height  0.931142  1.000000"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "## Correlation\n",
    "df.corr()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<seaborn.axisgrid.PairGrid at 0x2a2d47d9370>"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAWUAAAFlCAYAAAAzhfm7AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8vihELAAAACXBIWXMAAAsTAAALEwEAmpwYAAAmtklEQVR4nO3de7ScdX3v8fdnEyAkISGQCyEmJ8YTQBIlYnRBLBTB1phlIb3IZdVzsIdT8JoCelSWLm3PgR6sFkqsWkAotEdoUquAWrk0FkG5NWqiiUKBEEnIbSdoQiIBwv6eP55nkslm9p6ZPc8zzzN7Pq+1Zs3MM7fv3hm+/Pbv+f2+X0UEZmZWDj1FB2BmZvs5KZuZlYiTsplZiTgpm5mViJOymVmJOCmbmZVIRyflBQsWBOCLL1lc6vL3zZcMLwPq6KS8bdu2okOwLuLvm7VDRydlM7PhxknZzKxERhQdgJlZWfT1Beu272bLzj1MHjuSGUeNpqdHbY3BSdnMjCQh37VmM5ctW8mel/sYeXAPV58zlwWzj25rYvb0hZkZsG777n0JGWDPy31ctmwl67bvbmscTspdYOq06UjK/DJ12vSifzSzzGzZuWdfQq7Y83IfW5/f09Y4PH3RBTZuWM+51z2Y+fsuvXh+5u9pVpTJY0cy8uCeAxLzyIN7mHT4yLbG4ZGymRkw46jRXH3OXEYenKTFypzyjKNGtzUOj5TNzICeHrFg9tEcv/hUtj6/h0mHe/WFmVmhenrEzIljmDlxTHExFPbJZmb2Kk7KZmYl4qRsZlYiuSVlSTdJ2ippddWxIyXdK+mJ9Hp81WOXS3pS0uOS3plXXGZmeerrC9b27uKhp7axtncXfX2DVup8lTxHyjcDC/od+ySwPCJmAcvT+0g6ATgPmJ2+5suSDsoxNjOzzFW2ai9c8gDn3/AIC5c8wF1rNjeVmHNLyhFxP/Bcv8NnA7ekt28BFlUd/6eIeDEingaeBN6aV2xmZnnIYqt2u+eUJ0fEJoD0elJ6fCqwv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/G9a0kpS0rHo2IDen7rgRmAD/ILPJhwEm5M1Tmld9AMn2xHvgosBP4HjA1Ik4Z5PW1yglWe7Hq9iv4e2ED6wFOiYgXqg9WJel6/F2rw3PKneGHJCUin4uIVyLiOZITcacAS4GJkk4BkHSwpNn9Xv8YMFPSjPT+uQ185vMk0xlm1e4BPly5I2lujec8DPxhevu8Bt/X37eUk3Jn+BnJqouH+x3bEUnLnD8CPidpFUnFsvnVL05HNR8E7pL0A2ALydTHgCJiO/BDJU1VfaLPKhYD85Q0jP050H/OGJKVFJdJehSYQp3vWup64Ls+0YerxHULSWMiYldaO/lLwBMRcU3Rcdnwk643fiEiQtJ5wPkRcXbRcXUKz+d0jz9NO2UcAvyEZDWGWR7eDPxtOgD4NVUrgaw+j5TNzErEc8pmZiXipGxmViJOymZmJeKkbGZWIk7KZmYl4qRsZlYi/x+b6EE92fiYLgAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 360x360 with 6 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "## Seaborn for visualization\n",
    "import seaborn as sns\n",
    "sns.pairplot(df)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {},
   "outputs": [],
   "source": [
    "## Independent and dependent features\n",
    "X=df[['Weight']] ### independent features should be data frame or 2 dimesnionalarray\n",
    "y=df['Height'] ## this variiable can be in series or 1d array\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(23,)"
      ]
     },
     "execution_count": 22,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "X_series=df['Weight']\n",
    "np.array(X_series).shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(23,)"
      ]
     },
     "execution_count": 25,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.array(y).shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "metadata": {},
   "outputs": [],
   "source": [
    "## Train Test Split\n",
    "from sklearn.model_selection import train_test_split\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "metadata": {},
   "outputs": [],
   "source": [
    "X_train,X_test,y_train,y_test=train_test_split(X,y,test_size=0.25,random_state=42)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "metadata": {},
   "outputs": [],
   "source": [
    "## Standardization\n",
    "from sklearn.preprocessing import StandardScaler"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "metadata": {},
   "outputs": [],
   "source": [
    "scaler=StandardScaler()\n",
    "X_train=scaler.fit_transform(X_train)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 33,
   "metadata": {},
   "outputs": [],
   "source": [
    "X_test=scaler.transform(X_test)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 34,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[ 0.33497168],\n",
       "       [ 0.33497168],\n",
       "       [-1.6641678 ],\n",
       "       [ 1.36483141],\n",
       "       [-0.45256812],\n",
       "       [ 1.97063125]])"
      ]
     },
     "execution_count": 34,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "X_test"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 35,
   "metadata": {},
   "outputs": [],
   "source": [
    "## Apply Simple Linear Regression\n",
    "from sklearn.linear_model import LinearRegression"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 39,
   "metadata": {},
   "outputs": [],
   "source": [
    "regression=LinearRegression(n_jobs=-1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 40,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "LinearRegression(n_jobs=-1)"
      ]
     },
     "execution_count": 40,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "regression.fit(X_train,y_train)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 44,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Coefficient or slope: [17.2982057]\n",
      "Intercept: 156.47058823529412\n"
     ]
    }
   ],
   "source": [
    "print(\"Coefficient or slope:\",regression.coef_)\n",
    "print(\"Intercept:\",regression.intercept_)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 46,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[<matplotlib.lines.Line2D at 0x2a2d7cc5a30>]"
      ]
     },
     "execution_count": 46,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXcAAAD4CAYAAAAXUaZHAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8vihELAAAACXBIWXMAAAsTAAALEwEAmpwYAAAeK0lEQVR4nO3deXxU9b3/8ddHQIgbURIqCWBcIApuaETcEBANRX9C7bXivbfaakVbrLa3xYK02tZq7Q+XLi4trVRpK9T2WqVFi2JVrAVpqAuLIoigAWUVXKAI4XP/yCTOGSaZyWRmzizv5+Phg5nPOZl8POrbk0/O+R5zd0REpLDsFXYDIiKSfgp3EZECpHAXESlACncRkQKkcBcRKUAdw24AoKyszKuqqsJuQ0QkryxcuHCju5fH25YT4V5VVUVdXV3YbYiI5BUzW93SNo1lREQKkMJdRKQAKdxFRAqQwl1EpAAp3EVECpDCXUSkACncRUQKkMJdRCQEuxp28+M5r7N83QcZ+fycuIlJRKSYPPjCW1z/p0UAbNm2k++e3z/t30PhLiKSJas2fsSQ255pfj+4bzk3nNcvI99L4S4ikmG7GnbzuV/M419vbWmuPT9hGJWlJRn7ngp3EZEMmrHgLSY8vKj5/Z0XHcdnBvTM+PdVuIuIZMDqTR9x5uRnmt+f0aeMB744kL32sqx8f4W7iEgaNex2LvrFPOpWv9dcizeCeeTF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riLiBSg/wPYMWp8NevZYgAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "## plot Training data plot best fit line\n",
    "plt.scatter(X_train,y_train)\n",
    "plt.plot(X_train,regression.predict(X_train))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### prediction of test data\n",
    "1. predicted height output= intercept +coef_(Weights)\n",
    "2. y_pred_test =156.470 + 17.29(X_test)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 49,
   "metadata": {},
   "outputs": [],
   "source": [
    "## Prediction for test data\n",
    "y_pred=regression.predict(X_test)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 50,
   "metadata": {},
   "outputs": [],
   "source": [
    "## Performance Metrics\n",
    "from sklearn.metrics import mean_absolute_error,mean_squared_error"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 51,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "114.84069295228699\n",
      "9.665125886795005\n",
      "10.716374991212605\n"
     ]
    }
   ],
   "source": [
    "mse=mean_squared_error(y_test,y_pred)\n",
    "mae=mean_absolute_error(y_test,y_pred)\n",
    "rmse=np.sqrt(mse)\n",
    "print(mse)\n",
    "print(mae)\n",
    "print(rmse)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## R square \n",
    "Formula\n",
    "\n",
    "**R^2 = 1 - SSR/SST**\n",
    "\n",
    "\n",
    "R^2\t=\tcoefficient of determination\n",
    "SSR\t=\tsum of squares of residuals\n",
    "SST\t=\ttotal sum of squares"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 52,
   "metadata": {},
   "outputs": [],
   "source": [
    "from sklearn.metrics import r2_score"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 53,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0.7360826717981276\n"
     ]
    }
   ],
   "source": [
    "score=r2_score(y_test,y_pred)\n",
    "print(score)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "**Adjusted R2 = 1 – [(1-R2)*(n-1)/(n-k-1)]**\n",
    "\n",
    "where:\n",
    "\n",
    "R2: The R2 of the model\n",
    "n: The number of observations\n",
    "k: The number of predictor variables"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 54,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.6701033397476595"
      ]
     },
     "execution_count": 54,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#display adjusted R-squared\n",
    "1 - (1-score)*(len(y_test)-1)/(len(y_test)-X_test.shape[1]-1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 55,
   "metadata": {},
   "outputs": [],
   "source": [
    "## OLS Linear Regression\n",
    "import statsmodels.api as sm"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 56,
   "metadata": {},
   "outputs": [],
   "source": [
    "model=sm.OLS(y_train,X_train).fit()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 57,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[  5.79440897   5.79440897 -28.78711691  23.60913442  -7.82861638\n",
      "  34.08838469]\n"
     ]
    }
   ],
   "source": [
    "prediction=model.predict(X_test)\n",
    "print(prediction)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 58,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "                                 OLS Regression Results                                \n",
      "=======================================================================================\n",
      "Dep. Variable:                 Height   R-squared (uncentered):                   0.012\n",
      "Model:                            OLS   Adj. R-squared (uncentered):             -0.050\n",
      "Method:                 Least Squares   F-statistic:                             0.1953\n",
      "Date:                Mon, 01 Aug 2022   Prob (F-statistic):                       0.664\n",
      "Time:                        19:51:00   Log-Likelihood:                         -110.03\n",
      "No. Observations:                  17   AIC:                                      222.1\n",
      "Df Residuals:                      16   BIC:                                      222.9\n",
      "Df Model:                           1                                                  \n",
      "Covariance Type:            nonrobust                                                  \n",
      "==============================================================================\n",
      "                 coef    std err          t      P>|t|      [0.025      0.975]\n",
      "------------------------------------------------------------------------------\n",
      "x1            17.2982     39.138      0.442      0.664     -65.671     100.267\n",
      "==============================================================================\n",
      "Omnibus:                        0.135   Durbin-Watson:                   0.002\n",
      "Prob(Omnibus):                  0.935   Jarque-Bera (JB):                0.203\n",
      "Skew:                          -0.166   Prob(JB):                        0.904\n",
      "Kurtosis:                       2.581   Cond. No.                         1.00\n",
      "==============================================================================\n",
      "\n",
      "Notes:\n",
      "[1] R² is computed without centering (uncentered) since the model does not contain a constant.\n",
      "[2] Standard Errors assume that the covariance matrix of the errors is correctly specified.\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Users\\win10\\anaconda3\\lib\\site-packages\\scipy\\stats\\stats.py:1603: UserWarning: kurtosistest only valid for n>=20 ... continuing anyway, n=17\n",
      "  warnings.warn(\"kurtosistest only valid for n>=20 ... continuing \"\n"
     ]
    }
   ],
   "source": [
    "print(model.summary())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 60,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([155.97744705])"
      ]
     },
     "execution_count": 60,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "## Prediction For new data\n",
    "regression.predict(scaler.transform([[72]]))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.5"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
